:root {
  --accent: #333;
  --secondary: #fff;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background: #e5e5e5;
  align-items: center;
  display: flex;
  line-height: 1.4;
  margin: 0;
}

svg {
  max-height: 100vh;
  width: 100%;
  overflow: visible;
  shape-rendering: crispEdges;
  vertical-align: middle;
}



/*  Title  */

.menu .text {
  opacity: 0.1;
}

.menu .selected .text {
  opacity: 1;
}

.menu .stars {
  display: none;
  shape-rendering: auto;
}

.menu .selected .stars {
  display: block;
}


/*  HUD  */

#hud {
  opacity: 0.1;
}


/*  Guy  */

#inner-guy {
  transform-origin: 13px;
}

.left #inner-guy {
  transform: scaleX(-1);
}

.walk #left_foot,
.walk #right_foot {
  animation: walk 0.2s infinite;
}

.walk #right_foot {
  animation-delay: 0.1s;
}

.walk #head {
  animation: walk 0.4s infinite;
  position: relative;
  z-index: 5;
}

.on #guy .accent,
.off #face {
  fill: var(--accent);
}

.on #face,
.off #guy .accent {
  fill: var(--secondary);
}



/*  Death Animation  */

#death rect {
  display: none;
}

.dying #death rect {
  animation: death 0.8s infinite;
  display: initial;
  opacity: 0;
}

@keyframes death {
  0% {
    opacity: 1;
    transform: rotate(45deg);
  }
  50% {
    opacity: 0;
    transform: rotate(0);
  }
}



/*  Goal  */

#inner-goal {
  animation: pulse 2s infinite;
  shape-rendering: auto;
  transform-origin: 12px 12px;
}

.finish #inner-goal {
  animation: none;
}

#inner-goal-finish {
  transition: transform 0.5s;
  transform-origin: 12px 12px;
}

.finish #inner-goal-finish {
  transform: scale(150);
}



/*  Swap Foreground/Background  */

.on > svg {
  background: var(--secondary);
  color: var(--accent);
  fill: var(--accent);
}

.off > svg {
  background: var(--accent);
  color: var(--secondary);
  fill: var(--secondary);
}

.on .dark, .off .light {
  opacity: 0.1;
}



/*  Animations  */

@keyframes walk {
  50% {
    transform: translateY(-2px);
  }
}

@keyframes pulse {
  50% {
    transform: scale(0.7);
  }
}



/*  Misc  */

[hidden] {
  display: none !important;
}



/* Editor */

#dialog {
  background: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  font-family: 'helvetica neue', helvetica, arial, sans-serif;
  font-size: 16px;
  right: 10px;
  padding: 25px;
  position: fixed;
  top: 10px;
  width: 400px;
}

h3 {
  margin: 0 0 15px;
}

ul {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

li {
  margin-bottom: 10px;
}

kbd {
  border: 2px solid #444;
  border-radius: 2px;
  display: inline-block;
  font-weight: bold;
  line-height: 1;
  padding: 4px 6px;
}

span {
  margin-left: 10px;
}
